import { Controller, Get, Post, Body, Patch,Res, Param,Response, Delete,UseInterceptors,UploadedFile } from '@nestjs/common';
import { UploadService } from './upload.service';
import { CreateUploadDto } from './dto/create-upload.dto';
import { UpdateUploadDto } from './dto/update-upload.dto';
import {FileInterceptor} from "@nestjs/platform-express"

@Controller('upload')
export class UploadController {
  constructor(private readonly uploadService: UploadService) {}

  @Post("push")
  @UseInterceptors(FileInterceptor("file"))
  uploadFile(@UploadedFile() file) {
    return this.uploadService.upload(file)
  }

  @Get("export")
  download(@Res() res){
    return this.uploadService.download(res)
  }
}
